package cn.java79.springcore;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author oldliu
 * @since 1.0
 */
public class Test2 {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext("app*.xml");
        //HelloSpring sp=(HelloSpring)ac.getBean("hello");
        HelloSpring sp= ac.getBean("hello",HelloSpring.class);
        HelloSpring sp2= ac.getBean("hello3",HelloSpring.class);
        System.out.println(sp==sp2);
        sp2.say();
        sp.say();
        ((ClassPathXmlApplicationContext) ac).close();
    }
}
